import instance from '../../axios/index'


// 获取商品列表
export const getGoodsList = async(page:any,pageNum:any) => {
        const res=await instance.get(`/Suit/goodsList?page=${page}&pageNum=${pageNum}`)
        return res

}

//添加商品
export const addGoods = async(data:any) => {
   
    
        const res=await instance.post('/Suit/addGoods',data)
        
        
        return res.data.data
}


//回显功能
export const getGoodsInfo = async(id:any) => {
        const res=await instance.get(`/Suit/editGoods?id=${id}`)
        return res.data.data
}


//修改商品
export const editGoods = async(data:any) => {
        const res=await instance.post('/Suit/editGoodsTo',data)
        return res.data.data
}

//删除商品
export const delGoods = async(id:any) => {
        const res=await instance.get(`/Suit/deleteGoods?id=${id}`)
        return res.data.data
}

//获取商品分类
export const getGoodsType = async() => {
        const res=await instance.get('/Suit/goodsCategory')
        return res.data.data
}
